<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>测试本地资源</title>
    <link href="/static/css/bootstrap.min.css" rel="stylesheet">
    <script src="/static/js/simple_chart.js"></script>
</head>
<body>
    <div class="container mt-5">
        <h1 class="text-center">测试本地资源加载</h1>
        <div class="card">
            <div class="card-body">
                <h5 class="card-title">Bootstrap样式测试</h5>
                <p class="card-text">如果看到这个卡片，说明Bootstrap CSS加载成功。</p>
                <button class="btn btn-primary">测试按钮</button>
            </div>
        </div>
        
        <div class="mt-5" style="height: 400px;">
            <canvas id="testChart"></canvas>
        </div>
    </div>
    
    <script>
        document.addEventListener('DOMContentLoaded', function() {
            if (typeof Chart !== 'undefined') {
                console.log('Chart.js加载成功');
                
                const ctx = document.getElementById('testChart').getContext('2d');
                new Chart(ctx, {
                    type: 'bar',
                    data: {
                        labels: ['一月', '二月', '三月', '四月', '五月', '六月'],
                        datasets: [{
                            label: '测试数据',
                            data: [12, 19, 3, 5, 2, 3],
                            backgroundColor: 'rgba(54, 162, 235, 0.2)',
                            borderColor: 'rgba(54, 162, 235, 1)',
                            borderWidth: 1
                        }]
                    },
                    options: {
                        scales: {
                            y: {
                                beginAtZero: true
                            }
                        }
                    }
                });
            } else {
                console.error('Chart.js未加载成功');
                alert('Chart.js未加载成功');
            }
        });
    </script>
</body>
</html>